package com.xiaohong.order.feign;

import com.xiaohong.order.fallback.OrderFallback;
import com.xiaohong.order.pojo.OrderTbl;
import entity.Result;
import entity.StatusCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name="order-service",contextId = "orderTbl",fallback = OrderFallback.class)
public interface OrderTblFeign {

    /***
     * 根据Id删除orderTbl数据
     * @param id
     * @return
     */
    @DeleteMapping(value = "/orderTbl/{id}" )
    Result delete(@PathVariable Integer id);

    /***
     * 根据ID修改OrderTbl数据
     * @param orderTbl
     * @param id
     * @return
     */
    @PutMapping(value = "/orderTbl/{id}" )
    Result update(@RequestBody OrderTbl orderTbl, @PathVariable Integer id);

    /***
     * 新增OrderTbl数据
     * @param orderTbl
     * @return
     */
    @PostMapping("/orderTbl")
    Result add(@RequestBody OrderTbl orderTbl);


    /***
     * 根据ID查询OrderTbl数据
     * @param id
     * @return
     */
    @GetMapping("/orderTbl/{id}")
    Result<OrderTbl> findById(@PathVariable Integer id);

    /***
     * 多条件搜索OrderTbl数据
     * @param orderTbl
     * @return
     */
    @PostMapping(value = "/orderTbl/search" )
    Result<List<OrderTbl>> findList(@RequestBody(required = false) OrderTbl orderTbl);

}
